import { defineUserConfig } from "vuepress";
// import type { DefaultThemeOptions } from "vuepress";
import recoTheme from "vuepress-theme-reco";
import { viteBundler } from '@vuepress/bundler-vite'
import { templateCompilerOptions } from '@tresjs/core';

export default defineUserConfig({
  title: "TvT.js",
  head: [['link', { rel: 'icon', href: '/logo.png' }], ["script", {}, `var _hmt = _hmt || [];
  (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?9ac430d309361163bdc69ddf76548960";
    var s = document.getElementsByTagName("script")[0]; 
    s.parentNode.insertBefore(hm, s);
  })();`]],
  description: "ICEGL图形学社区是一个热衷于计算机图形学和视觉效果的开源社区。我们汇聚了一群热爱创造和探索的开发者、设计师和研究人员，共同致力于推动图形学领域的创新和发展。",
  theme: recoTheme({
    style: "@vuepress-reco/style-default",
    primaryColor: '#1f86e6',
    logo: "/logo.png",
    // author: "icegl",
    authorAvatar: "/head.jpg",
    lastUpdated: false,
    // lastUpdatedText: "...zzzZZZ",
    catalogTitle: '本页目录',
    // series 为原 sidebar
    series: {
      "/docs/three-vue-tres": [
        {
          text: "引导",
          children: ["/docs/three-vue-tres/guide/introduction", "/docs/three-vue-tres/guide/start", "/docs/three-vue-tres/guide/first", { text: "📀预览", link: 'https://opensource.icegl.cn/' }],
        },
        {
          text: "基础",
          children: ["/docs/three-vue-tres/base/directory", "/docs/three-vue-tres/base/config", "/docs/three-vue-tres/base/route",
            "/docs/three-vue-tres/base/css", "/docs/three-vue-tres/base/resources"],
        },
        {
          text: "三维核心",
          children: ["/docs/three-vue-tres/core/variable", "/docs/three-vue-tres/core/object", "/docs/three-vue-tres/core/geometry", "/docs/three-vue-tres/core/material"
            , "/docs/three-vue-tres/core/extend", "/docs/three-vue-tres/core/event", "/docs/three-vue-tres/core/controls"],
        },
        {
          text: "前端相关",
          children: ["/docs/three-vue-tres/frontend/store", "/docs/three-vue-tres/frontend/network"],
        },
        {
          text: "插件",
          children: ["/docs/three-vue-tres/plugin/introduction", "/docs/three-vue-tres/plugin/manage", "/docs/three-vue-tres/plugin/directory"],
        },
        {
          text: "三维编辑器",
          children: ["/docs/three-vue-tres/editor/threeeditor", "/docs/three-vue-tres/editor/totvt"],
        },
        {
          text: "UI编辑器",
          children: ["/docs/three-vue-tres/editor/goview","/docs/three-vue-tres/editor/usegwjson"],
        },
        { text: "其他", children: [{ text: "❔常见问题", link: '/docs/three-vue-tres/other/questions' }] }
      ],
    },
    // autoSetSeries: true,
    navbar: [
      { text: "🧊首页", link: "/" },
      {
        text: "📚文档",
        children: [
          { text: "🧊 TvT.js", link: "/docs/three-vue-tres/guide/introduction" },
          { text: "🎲 three.js", link: "https://threejs.org/docs/index.html#manual/zh/introduction/Creating-a-scene" },
          { text: "⚡ tres.js", link: "https://tresjs.org/guide/" },
          { text: "💠 fes.js", link: "https://fesjs.mumblefe.cn/" },
        ],
      },
      { text: "📀预览演示", link: "https://opensource.icegl.cn/" },
      { text: "🧊ICEGL官网", link: "https://icegl.cn/" },
      {
        text: "👨‍🏫课程中心", children: [{ text: "🌁 WebGL初/中/高级教程", link: "https://icegl.cn/courses.html" }, { text: "🏙 WebGL Shader初级教程", link: "https://www.bilibili.com/video/BV1iR4y1C7LQ" }
          , { text: "🌇 WebGL Shader中级教程", link: "https://m.study.163.com/provider/480000002303414/index.htm?share=2&shareId=480000002303414" }]
      },
      { text: "🅱️B站主页", link: "https://space.bilibili.com/410503457" },
      { text: "🙋‍♀️社区问答", link: "https://icegl.cn/ask" },
      {
        text: "💫关于",
        children: [
          { text: "⛄aboutUs", link: "/docs/about/us" },
          { text: "❔常见问题", link: "/docs/three-vue-tres/other/questions" },
        ],
      },
      // { text: "分类", link: "/categories/reco/1/" },
      // { text: "标签", link: "/tags/tag1/1/" },
    ],
    bulletin: {
      title: '公告',
      body: [
        {
          type: "text",
          content: `🎉🎉🎊 热烈庆祝，icegl呕心沥血半年，出品的三维可视化项目快速落地の开源框架 🎊🎉🎉<br />
          <a style='color: #5d67e8;font-weight: bolder;' href="https://gitee.com/ice-gl/icegl-three-vue-tres">🏕点击预览：icegl-three-vue-tres<a/><br />
          永久开源且免费商用，持续更新ing<br />
          望大家关注💛 点赞⭐ fork👣支持`,
          style: "font-size: 12px;",
        },
        {
          type: "hr",
        },
        {
          type: "title",
          content: "联系我们",
        },
        {
          type: "text",
          content: `
            <a href="https://space.bilibili.com/410503457">B站主页<a/>
            <a href="https://www.icegl.cn/ask">问答社区<a/>
            <br />`,
          style: "font-size: 12px;display: flex;justify-content: space-around;text-decoration: underline;",
        },
        // {
        //   type: "hr",
        // },
        // {
        //   type: "title",
        //   content: "微信群",
        // },
        {
          type: "text",
          content: `
          <span>几个群已满，加微信进webgl学习交流群</span>
          <img src="/qrcode.png">
          `,
          style: "font-size: 12px;",
        },
        // {
        //   type: "hr",
        // },
        // {
        //   type: "buttongroup",
        //   children: [
        //     {
        //       text: "打赏",
        //       link: "/docs/others/donate.html",
        //     },
        //   ],
        // },
      ],
    },
    // commentConfig: {
    //   type: 'valie',
    //   // options 与 1.x 的 valineConfig 配置一致
    //   options: {
    //     // appId: 'xxx',
    //     // appKey: 'xxx',
    //     // placeholder: '填写邮箱可以收到回复提醒哦！',
    //     // verify: true, // 验证码服务
    //     // notify: true,
    //     // recordIP: true,
    //     // hideComments: true // 隐藏评论
    //   },
    // },
    // algolia: {
    //   appId: 'S9LOLS0U2X',
    //   apiKey: '24a5da50495a929aa5dc971b2c080238',
    //   indexName: 'icegl',
    //   inputSelector: '### 搜索我 ####',
    //   algoliaOptions: { 'facetFilters': ["lang:$LANG"] },
    //   debug: false // Set debug to true if you want to inspect the dropdown
    // },
  }),
  // debug: true,
  bundler: viteBundler({
    viteOptions: {},
    vuePluginOptions: {
      ...templateCompilerOptions,
    },
  }),
});
